<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="ja" xml:lang="ja">
	<head>
		<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
		<meta http-equiv="Content-Script-Type" content="text/javascript" />
		<meta http-equiv="Content-Style-Type" content="text/css" />
		<title>コントロールパネル</title>
		<link rel="stylesheet" href="./assets/styles/default.css" type="text/css" />
		<link rel="stylesheet" href="./assets/styles/ui-lightness/ui.all.css" type="text/css" />
		<link rel="stylesheet" href="./assets/styles/ui-lightness/jquery-ui-1.7.3.custom.css" type="text/css" />
		<link rel="stylesheet" href="./assets/styles/dialog.css" type="text/css" />
		<script src="assets/scripts/jquery-1.7.1.min.js" type="text/javascript"></script>
		<script src="assets/scripts/jquery-ui-1.7.3.custom.min.js" type="text/javascript"></script>
		<script src="assets/scripts/ui/ui.dialog.js" type="text/javascript"></script>
		<script src="assets/scripts/menu.js" type="text/javascript"></script>
		<script src="assets/scripts/table.js" type="text/javascript"></script>
		
		<script type="text/javascript" src="./assets/scripts/ui/ui.core.js"></script>
		<script type="text/javascript" src="./assets/scripts/ui/ui.datepicker.js"></script>
		<script type="text/javascript" src="./assets/scripts/search.js"></script>
		<script type="text/javascript">
		$(function() {
			$('.message').fadeIn("slow");
			$('.text_date').datepicker({
				changeMonth: true,
				changeYear: true,
				dateFormat: 'yy/mm/dd'
			});
			
			$(function() {
				$('#btn-export').click(function(){	
					if(confirm('ダウンロードしますか？')){
						document.fm.csv.value="download";
						document.fm.submit();
					}
				});
			});
			
			$('#year4').change(function(){
				var year4 = this.value;
				var myDate = new Date();
				var nowtime =  myDate.getTime();
					
				$.get("mmap_week_ajax.php",{ y: year4,t : nowtime }, function(data){
					$("#week_cd1").children().remove();
					$("#week_cd1").append( data ); 
					$("#week_cd2").children().remove();
					$("#week_cd2").append( data ); 
				});
			});
			
			$('.sort').change(function(){
				if (this.value == 2) {
					$('#tr_op4')['hide']();
					$('#tr_op3')['hide']();
					$('#tr_op2')['show']();
				}else if (this.value == 3) {
					$('#tr_op2')['hide']();
					$('#tr_op4')['hide']();
					$('#tr_op3')['show']();
				}else if (this.value == 4) {
					$('#tr_op2')['hide']();
					$('#tr_op3')['hide']();
					$('#tr_op4')['show']();
				}else {
					$('#tr_op2')['hide']();
					$('#tr_op3')['hide']();
					$('#tr_op4')['hide']();
				}
			});
		});
		
		function chkWeek() {
			var weekid = $("#week_cd").val() ;
			if (weekid.length == 0){
				alert("週を選択してください");
				return false;
			 }
			return true;
		}
		function setSS( valcd, valnm ) {
			document.fm.shop_cd.value = valcd;
			document.fm.shop_name.value = valnm;			
			$('#dialog').dialog("close");
		}
	
		function li_add(objID,inID, inVal) {
			if (checkNames(inID)) {
				var strHtml = "<li id='a" + inID +"' class='item_li'> <a href='#'  style='color:red' class='li_del' >X</a>&nbsp;&nbsp;"+ inID + "&nbsp;&nbsp;" + inVal;
				strHtml = strHtml + "<input type='hidden' value='" + inID + "' name ='" + gMutiObj +"_cd[]'>";
				strHtml = strHtml + "<input type='hidden' value='" + inVal + "' name ='" + gMutiObj +"_name[]'>";
				strHtml = strHtml + "</li>";
				$("#" + objID +"_ul").append(strHtml);

			}
		}
		</script>
		<link rel="stylesheet" type="text/css" href="./assets/styles/tablesorter.css" />
		<script type="text/javascript" src="./assets/scripts/tablesorter.js"></script>
	</head>
	<body id="">
{{$menu}}
{{$logout}}
		<div id="container"><div class="wrapper">
			<h2>印刷手配管理</h2>
			<ul class="submenu clearfix">
				<li><a href="tmoncell_index.php">月間.セール明細情報一覧</a></li>
				{{if (!$isG7) && (!$isG23) }}<li><a href="tmoncell_form.php">月間.セール明細情報登録</a></li>{{/if}}
				{{if !$isG7 }}<li><a href="tmoncell_update.php">月間.セール明細情報更新</a></li>{{/if}}
				{{if !$isG23 }}<li><a href="tmoncellprn_index.php">印刷部数明細</a></li>{{/if}}
				<li>店舗実施一覧表</li>
			</ul>
			<h3>店舗実施一覧表出力</h3>
			{{if $errmsg }}<div class="errmsg"><p class="error">{{ $errmsg|escape }}</p> </div> {{/if}}
			<form name="fm" id="fm" method="post" action="tmoncellshop_index.php" >
				<input type="hidden" name="page" />
				<table class="formTable">
					<tbody>
					<tr><th>種別</th><td>
{{ html_radios name='sort' class="sort" options=$cellsort selected=$forms.sort separator='&nbsp;' }}
					</td></tr>
						<tr id = "tr_op2"  style="display: {{$authtg2}};">
							<th>エリア</th>
							<td>
{{ html_options name='areauser' options=$areauser selected=$forms.areauser }}{{ $err.areauser }}
							</td>
						</tr>
						<tr id = "tr_op3"  style="display: {{$authtg3}};">
							<th>ゾーン</th>
							<td>
{{ html_options id='zone_cd' name='zone_cd'  options=$zone selected=$forms.zone_cd }}{{ $err.zone_cd }}
							</td>
						</tr>
						<tr id = "tr_op4"  style="display: {{$authtg4}};">
							<th>店舗</th>
							<td>
		<button type="button" id="shop" class="btn_search_muti" ><span>店舗追加</span></button><br>
								<ul id="shop_ul" class="item_ul">	
{{ foreach from=$forms.mutirow key=k item=v name="member" }}
									<li  class='item_li'>
									 <a href='#' class='li_del'  >X</a>&nbsp;&nbsp;{{ $v.shop_cd }}&nbsp;&nbsp;{{ $v.shop_name }}
									<input type='hidden' value='{{ $v.shop_cd }}' name ='shop_cd[]'>
									<input type='hidden' value='{{ $v.shop_name }}' name ='shop_name[]'>
									</li>
{{ /foreach }}
								</ul>
								 {{ $err.shop_cd }}
							</td>
						</tr>
						<tr><th>期間<span>※</span></th><td>
{{ html_options id='year4' name='year4' options=$year4 selected=$forms.year4 }} 年{{ $err.year4 }}&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
{{ html_options id='week_cd1' name='ww1' options=$week  selected=$forms.ww1 }}{{ $err.ww1 }} ～ 
{{ html_options id='week_cd1' name='ww2' options=$week  selected=$forms.ww2 }}{{ $err.ww2 }}
							</td></tr>
					</tbody>
				</table>
				<p class="button" style="text-align:center">
					<button type="button" id="btn-export" class="submit"><span>CSV出力</span></button>
				</p>
				<input type="hidden" name="search" value="1" />
				<input type="hidden" name="csv" />
			</form>
<div id="dialog" >
</div>
 <div id="dialogmuti" >
</div>
 
		</div></div>
		{{ $footer }}
	</body>
</html>